﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using WebMatrix.WebData;

namespace HackApp.Controllers
{
  public class MembershipRoles
  {
    public static string ADMIN = "Admin";
    public static string DEV = "Dev";
    public static string USER = "User";
  }

    public class InitController : Controller
    {
        //
        // GET: /Init/

        public String Index()
        {
          
          //if (!Roles.RoleExists(MembershipRoles.ADMIN))
          //{
          //  Roles.CreateRole(MembershipRoles.ADMIN);
          //}
          //if (!Roles.RoleExists(MembershipRoles.DEV))
          //{
          //  Roles.CreateRole(MembershipRoles.DEV);
          //}
          //if (!Roles.RoleExists(MembershipRoles.USER))
          //{
          //  Roles.CreateRole(MembershipRoles.USER);
          //}

          //WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);


          //string userAdmin="admin";
          //if (!WebSecurity.UserExists(userAdmin))
          //{
          //  WebSecurity.CreateAccount(userAdmin, "123456", requireConfirmationToken: false);
          //  if (!Roles.IsUserInRole(userAdmin))
          //  {
          //    Roles.AddUserToRole(userAdmin, MembershipRoles.ADMIN);
          //  }
          //}
          return String.Empty;
        }

    }
}
